﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fonour.Domain.Entities;
using Fonour.Domain.IRespositories;

namespace Fonour.EntityFrameworkCore.Repositories
{
    public class UserRepository : FonourRepositoryBase<User>, IUserRepository
    {
        private readonly FonourDbContext _dbContext;


        public UserRepository(FonourDbContext dbContext) : base(dbContext)
        {
            _dbContext = dbContext;
        }

        public User CheckUser(string userName, string password)
        {
            return _dbContext.Set<User>().FirstOrDefault(it => it.UserName == userName && it.Password == password);
        }
    }
}
